﻿using System;
using System.ComponentModel;

namespace System.ApplicationModel
{
    public partial class Entity : IEditableObject
    {
        #region IEditableObject Implementation
        /// <summary>
        /// Begins an edit on an object.
        /// </summary>
        protected void BeginEdit()
        {
            this.Backup();
        }

        /// <summary>
        /// Discards changes since the last System.ComponentModel.IEditableObject.BeginEdit() call.
        /// </summary>
        protected void CancelEdit()
        {
            this.RejectChanges();
        }

        /// <summary>
        /// Pushes changes since the last System.ComponentModel.IEditableObject.BeginEdit() or System.ComponentModel.IBindingList.AddNew() call into the underlying object.
        /// </summary>
        protected void EndEdit()
        {
            this.AcceptChanges();
        }

        void IEditableObject.BeginEdit()
        {
            this.BeginEdit();
        }

        void IEditableObject.CancelEdit()
        {
            this.CancelEdit();
        }

        void IEditableObject.EndEdit()
        {
            this.EndEdit();
        }
        #endregion
	}
}
